package com.bob.web.common.adapter;

import com.bob.web.common.interceptor.CorsInterceptor;
import com.bob.web.common.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * rest适配器
 * Author: liuhuan
 * Date:  17/3/8 下午10:42
 */
@Configuration
@EnableWebMvc
public class WebConfigurerAdapter extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CorsInterceptor());
        registry.addInterceptor(new LoginInterceptor());
    }


//    @Bean
//    public MessageConverter messageConverter() {
//        return new MessageConverter();
//    }
}